package com.jacoco.incremental.config;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 配置文件信息
 */
public class JacocoConfig {
    private String jacocoPathSource;
    private String jacocoPathReport;
    // 根据sourcePath 读取源码，支持多个 例子： "xx,yy,zz"
    private String[] jacocoGitSourcePath;
    // 编译后文件目录 支持多个 例子： "xx,yy,zz"
    private String[] jacocoGitBuildTarget;
    private String jacocoGitUrl;
    private String jacocoGitUser;
    private String jacocoGitPswd;
    private String jacocoGitBranch = "master";
    private String jacocoGitV1;
    private String jacocoGitV2;
    private List<String> jacocoGitInclude;
    private List<String> jacocoGitExculde;
    private String jacocoServerIp;
    private String jacocoServerPort;

    //    统计信息
    private List<String> classPath; // 所有差异类
    private Map<String, List<String>> diffInfos = new HashMap<>(); // 坐标点


    private static JacocoConfig config = null;

    private JacocoConfig() {
    }

    public static JacocoConfig getJacocoConfig() {
        return config = config == null ? new JacocoConfig() : config;
    }

    public String getJacocoPathSource() {
        return jacocoPathSource;
    }

    public JacocoConfig setJacocoPathSource(String jacocoPathSource) {
        this.jacocoPathSource = jacocoPathSource;
        return this;
    }

    public String getJacocoPathReport() {
        return jacocoPathReport;
    }

    public JacocoConfig setJacocoPathReport(String jacocoPathReport) {
        this.jacocoPathReport = jacocoPathReport;
        return this;
    }

    public String getJacocoGitUrl() {
        return jacocoGitUrl;
    }

    public JacocoConfig setJacocoGitUrl(String jacocoGitUrl) {
        this.jacocoGitUrl = jacocoGitUrl;
        return this;
    }

    public String getJacocoGitUser() {
        return jacocoGitUser;
    }

    public JacocoConfig setJacocoGitUser(String jacocoGitUser) {
        this.jacocoGitUser = jacocoGitUser;
        return this;
    }

    public String getJacocoGitPswd() {
        return jacocoGitPswd;
    }

    public JacocoConfig setJacocoGitPswd(String jacocoGitPswd) {
        this.jacocoGitPswd = jacocoGitPswd;
        return this;
    }

    public String getJacocoGitBranch() {
        return jacocoGitBranch;
    }

    public JacocoConfig setJacocoGitBranch(String jacocoGitBranch) {
        this.jacocoGitBranch = jacocoGitBranch;
        return this;
    }

    public String getJacocoGitV1() {
        return jacocoGitV1;
    }

    public JacocoConfig setJacocoGitV1(String jacocoGitV1) {
        this.jacocoGitV1 = jacocoGitV1;
        return this;
    }

    public String getJacocoGitV2() {
        return jacocoGitV2;
    }

    public JacocoConfig setJacocoGitV2(String jacocoGitV2) {
        this.jacocoGitV2 = jacocoGitV2;
        return this;
    }

    public List<String> getJacocoGitInclude() {
        return jacocoGitInclude;
    }

    public JacocoConfig setJacocoGitInclude(List<String> jacocoGitInclude) {
        this.jacocoGitInclude = jacocoGitInclude;
        return this;
    }

    public List<String> getJacocoGitExculde() {
        return jacocoGitExculde;
    }

    public JacocoConfig setJacocoGitExculde(List<String> jacocoGitExculde) {
        this.jacocoGitExculde = jacocoGitExculde;
        return this;
    }

    public String getJacocoServerIp() {
        return jacocoServerIp;
    }

    public JacocoConfig setJacocoServerIp(String jacocoServerIp) {
        this.jacocoServerIp = jacocoServerIp;
        return this;
    }

    public List<String> getClassPath() {
        return classPath;
    }

    public JacocoConfig setClassPath(List<String> classPath) {
        this.classPath = classPath;
        return this;
    }

    public Map<String, List<String>> getDiffInfos() {
        return diffInfos;
    }

    public JacocoConfig setDiffInfos(Map<String, List<String>> diffInfos) {
        this.diffInfos = diffInfos;
        return this;
    }

    public String getJacocoServerPort() {
        return jacocoServerPort;
    }

    public JacocoConfig setJacocoServerPort(String jacocoServerPort) {
        this.jacocoServerPort = jacocoServerPort;
        return this;
    }


    public String[] getJacocoGitSourcePath() {
        return jacocoGitSourcePath;
    }

    public JacocoConfig setJacocoGitSourcePath(String[] jacocoGitSourcePath) {
        this.jacocoGitSourcePath = jacocoGitSourcePath;
        return this;
    }

    public static JacocoConfig getConfig() {
        return config;
    }

    public static void setConfig(JacocoConfig config) {
        JacocoConfig.config = config;
    }

    public String[] getJacocoGitBuildTarget() {
        return jacocoGitBuildTarget;
    }

    public JacocoConfig setJacocoGitBuildTarget(String[] jacocoGitBuildTarget) {
        this.jacocoGitBuildTarget = jacocoGitBuildTarget;
        return this;
    }
}
